package com.example.demo.web.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;


@Data
public class Address implements Serializable {

    private Integer id;

    @JsonIgnore
    @NotNull(message = "短信验证码不能为空")
    @Size(min = 4, max = 4, message = "短信验证码只能四位")
    private String captcha;

    @NotBlank(message = "手机号码不能为空")
    @NotNull(message = "手机号码不能为空")
    @Pattern(regexp = "^[1][3,4,5,6,7,8,9][0-9]{9}$", message = "手机号格式不正确")
    private String mobile;

    private String consignee;

    private String province;

    private String city;

    private String district;

    private String detail;
}
